package com.example.serverdemo.controller;

import com.example.serverdemo.entity.User;
import com.example.serverdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Coding路人王
 * @date 2022/6/14 18:44
 */
@RestController
public class TestVueController {

    @Autowired
    private UserService userService;

    @GetMapping("/api/hello")
    public List<User> hello(){
        List<User> list = userService.list();
        return list;
    }

}
